<h1><?php echo $title;?></h1>

<?php
echo form_open_multipart('cresource/edit');
echo "<table class='table-manipulate'>";
echo "<tr><td><label for='file_type_id'>Resource type</label></td>";
echo "<td>";
echo form_dropdown('file_type_id',$filetypes,$resource['file_type_id'], 'style="width:auto;height:25px; padding:2px;"');
echo "</td></tr>";

echo "<tr><td><label for='file_src'>Upload Resource</label></td>";
echo "<td>";
$data = array('name'=>'file_src', 'class'=>'image-edit','id'=>'file_src');
echo form_upload($data);
echo "<a href='#' class='cancel'>Cancel</a>";
echo "<img title='change image' class='img-change' style='style:width:80px; height:80px;'  src=".base_url().'images/'.$_SESSION['username'].'/'.$resource['file_src']." /></p>";
echo "</td></tr>";

echo "<tr><td><label for='semester'>Semester</label></td>";
echo "<td>";
$options = array('I' => 'I', 'II' => 'II');
echo form_dropdown('semester',$options,$resource['semester'], 'style="width:105px;height:25px; padding:2px;"');
echo "</td></tr>";

echo "<tr><td><label for='shift'>Shift</label></td>";
echo "<td>";
echo form_dropdown('shift_id',$shifts ,$resource['shift_id'], 'style="width:105px;height:25px; padding:2px;"');
echo "</td></tr>";

echo "<tr><td><label for='group'>Group</label></td>";
echo "<td>";
$data = array('name'=>'group','id'=>'group','size'=>10,'value'=>$resource['group']);
echo form_input($data);
echo "</td></tr>";

echo "<tr><td><label for='batch'>Batch</label></td>";
echo "<td>";
$data = array('name'=>'batch','id'=>'batch','size'=>10,'value'=>$resource['batch']);
echo form_input($data);
echo "</td></tr>";

echo "<tr><td><label for='year'>Year</label></td>";
echo "<td>";
$data = array('name'=>'year','id'=>'year','size'=>10,$resource['year']);
echo form_input($data);
echo "</td></tr>";

echo "<tr><td><label for='course_id'>Course</label></td>";
echo "<td>";
echo form_dropdown('course_id',$courses, $resource['course_id'], 'style="width:auto;height:25px; padding:2px;"');
echo "</td></tr>";

echo "<tr><td><label for='activate'>Activate</label></td>";
echo "<td>";
$options = array('1' => 'active', '0' => 'inactive');
echo form_dropdown('activate',$options,$resource['activate'], 'style="width:105px;height:25px; padding:2px;"');
echo "</td></tr>";
echo "</table>";

echo form_hidden('file_id',$resource['file_id']);
echo form_submit(array('class'=>'btn','name'=>'submit'),'Update Resource');
echo form_close();


?>